import os, sys, tempfile, copy, re
from .process import *
from subprocess import *

class program:
    def __init__(self, name):
        self.name = name # name of program (should be in PATH)
        self.processes = {}

    def add_process(self, name, input_type = "S", output_type = "S", mode_count = None, description = ""):
        #print(name, mode_count)

        #print(name)
        p = process(name, input_type, output_type, mode_count, description)
        p.program = self
        self.processes[p.name] = p
        setattr(self, p.name, p)
        return p

